import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.HashMap;
import java.util.List;


public class ReadFun extends Fun {

	Expr result;
	public ReadFun(HashMap syms) {
		super(syms);
		System.out.println("Enter value:");
		BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
		try {
			String text = reader.readLine();
			this.result = new NumExpr(syms, text);
		} catch(Exception e) {
			this.result = new NumExpr(syms, -1);
		}
	}
	@Override
	public Expr run(List args) throws Exception {
		return this.result;
	}

}
